## -*- coding: utf-8 -*-
<%namespace name="w" file="/widgets.mak" />
<html>
  <head>
    ${self.base_head()}
    ${self.head()}
  </head>
  <body>
    <div id="header">
      ${ self.header() }
    </div>
    <div id="main">
      <div id="leftmenu">
        ${ self.leftmenu() }
      </div>
      <div id="main_content">
        ${ self.main_content() }
      </div>
    </div>
    <div id="footer">
      ${ self.footer() }
    </div>
  </body>
</html>

<%def name="title()" filter="trim">Bia Hanoi Blog</%def>

<%def name="base_head()" filter="trim">
  <title>${ self.title() }</title>
  <link rel="stylesheet" type="text/css" href="/site.css" />
</%def>

<%def name="head()" filter="trim"></%def>

<%def name="menu()" filter="trim">
  <%
    from google.appengine.api import users
  %>
  <div class="menu">
      ${ w.username() }
    | ${ h.link_to(u'日記一覧', h.url('diaries')) }
  % if users.is_current_user_admin():
    | ${ h.link_to(u'新規投稿', h.url('new_diary')) }
  % endif
    | ${ h.link_to('sourcecode', h.url('http://code.google.com/p/bia-hanoi/'), target='_blank') }
    | ${ w.logout() }
  </div>
</%def>

<%def name="header()" filter="trim">
  ${ self.menu() }
  <h1>Bia Hanoi Blog</h1>
</%def>

<%def name="footer()" filter="trim">
  &copy;2008 ${ h.link_to("TriAx", "http://triax.jp/", popup=True) }
</%def>

<%def name="main_content()" filter="trim">
  ${ next.body() }
</%def>

<%def name="leftmenu()" filter="trim"></%def>
